package demo1215.pm;

/*
String和StringBuilder的相互转换
String-->StringBuilder
1.StringBuilder的构造方法 public StringBuilder(String str);

StringBuilder -->String
1.StringBuilder类中的public String toString();
2.String类中的构造方法
   public String(StringBuilder ss);


 */
public class Demo_04 {
    public static void main(String[] args) {
        StringBuilder s = new StringBuilder("hello");
        s.append(true).append(2134);
        //把StringBuilder对象转换为String对象
        String s1 = new String(s);
        System.out.println(s1);

    }
}
